
@extends ('layouts/app')

@section('content')
    <div class="seoips">
        <header class="demos-header">
            <h1 class=" Card ">温馨提示:充值金额仅用于消费</h1>
        </header>
        <div class="prepaity">

            {{--<a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg ">--}}
                {{--<div class="weui-media imgbor ">--}}
                   {{--<div class="imgboreh">--}}
                       {{--<div class="minilogo">--}}
                           {{--<img class="" src="/img/logo2.png" alt="">--}}
                       {{--</div>--}}
                       {{--<div class="minilogo">--}}
                           {{--<h4 class="direct fu12 ">掌里通智慧城市</h4>--}}
                       {{--</div>--}}
                       {{--<div>--}}
                           {{--<h1 class="direct_mi" >200</h1>--}}
                       {{--</div>--}}
                   {{--</div>--}}

                {{--</div>--}}
            {{--</a>--}}
            {{--<header class="demos-header">--}}
                {{--<h1 class=" Card ">充200当260用</h1>--}}
            {{--</header>--}}
        </div>
    </div>
    <script>
//        var id = getRequest().id;
        var userInfo = Storage.get("userInfo");
        if (userInfo.status) {
               userInfo = JSON.parse(userInfo.value);
            var id = userInfo[0].id;
        }

        console.log("location", location);
            function getFillcar() {
                $.post("../api/getShareCards",{},function(res){
                    if(typeof res === 'string'){
                         res = JSON.parse(res);
                    }
                    console.log("res",res);
                    if(res.code === 200){
                    var data= {};
                        data['type'] ='fillcard';
                        data['element'] =".prepaity";
                        data['data'] = res.data;
                        A.init(data);
                    }
                });
            }
            getFillcar();
        //点击分享链接
        var url = location.href + "?id=" + id;
        console.log("url", url);


        $(".prepaity").on("click", ".dd_czk", function () {
            var money = $(this).find(".direct_mi").text();
            console.log("money", money);
            console.log("id", id);
            $.post("../api/shareCard",{money: money },function(res){
                if (typeof res === 'string'){
                    res = JSON.parse(res);
                }
//                console.log("res",res);
//                if(res.code === 200){
//
//                }
                // 拿到订单ID，去支付
                location.href = '/mobile/payment?id=' + res.data.order_id + '&money=' + res.data.money + '&order_type=' + res.data.order_type;
            })
        })

    </script>
@endsection

